using System;
using System.Collections.Generic;
using System.Text;
using System.Net.Sockets;

namespace Autobot
{
    public enum ClientType : byte
    {
        DEFAULT = 0x00,
        ROBOT = 0x01,
        VIEWER = 0x02
    }

    public class Client
    {
        protected NetworkStream networkStream = null;
        protected System.IO.StreamReader streamReader = null;
        protected System.IO.StreamWriter streamWriter = null;

        public System.IO.StreamReader GetStreamReader()
        {
            return streamReader;
        }

        public System.IO.StreamWriter GetStreamWriter()
        {
            return streamWriter;
        }

        public void InitializeStream(NetworkStream a_networkStream, System.IO.StreamReader a_streamReader, System.IO.StreamWriter a_streamWriter)
        {
            networkStream = a_networkStream;
            streamReader = a_streamReader;
            streamWriter = a_streamWriter;
        }

        public UInt32 GetID()
        {
            return id;
        }

        public string GetName()
        {
            return name;
        }

        public Socket GetSocket()
        {
            return socket;
        }

        

        public ClientType GetClientType()
        {
            return type;
        }

        public void SetName(string a_name)
        {
            name = a_name;
        }

        public void SetClientType(ClientType a_type)
        {
            type = a_type;
        }
 
        public Client(Socket a_socket)
        {
            socket = a_socket;
            count++;
            id = count;
        }
        
        static UInt32 count = 0;
        private UInt32 id;
        private string name;
        private Socket socket;
        private ClientType type;
    }
}
